<div class="dashboard-widgets-container" data-dashboard-id="{{ id }}">
    {{# csrf_token }}
        {{> csrf_token_input }}
    {{/ csrf_token }}
    {{# can_update_dashboards }}
        {{> edit-layout-dropdown }}
    {{/ can_update_dashboards }}
    <span class="dashboard-widgets-empty-line {{# can_update_dashboards }}dragula-container{{/ can_update_dashboards }}"></span>
    {{# widget_lines }}
        <div
            class="dashboard-widgets-row {{ layout }}"
            data-line-id="{{ line_id }}"
            data-current-layout="{{ layout }}"
        >
            <span class="dashboard-widgets-empty-column {{# can_update_dashboards }}dragula-container{{/ can_update_dashboards }}"></span>
            {{# widget_columns}}
                <div class="dashboard-widgets-column {{# can_update_dashboards }}dragula-container{{/ can_update_dashboards }}" data-column-id="{{ column_id }}">
                    {{# widgets }}
                        <section class="tlp-pane dashboard-widget
                                    {{# is_minimized }}dashboard-widget-minimized{{/is_minimized}}
                                 "
                                 data-widget-id="{{ widget_id }}"
                        >
                            {{# csrf_token }}
                                {{> csrf_token_input }}
                            {{/ csrf_token }}
                            <div class="tlp-pane-container dashboard-widget-container">
                                <div class="tlp-pane-header
                                        dashboard-widget-header
                                        {{# can_update_dashboards }}dashboard-widget-movable{{/ can_update_dashboards }}
                                    "
                                    {{# can_update_dashboards }}data-draggable="true"{{/ can_update_dashboards }}
                                >
                                    <h1 class="tlp-pane-title"
                                        {{# can_update_dashboards }}data-draggable="true"{{/ can_update_dashboards }}
                                    >
                                        {{# has_icon }}
                                            <i class="tlp-pane-title-icon fa {{ icon }}"></i>
                                        {{/ has_icon }}
                                        {{# has_custom_title }}
                                            <span class="dashboard-widget-header-title">{{{ purified_custom_title }}}</span>
                                        {{/ has_custom_title }}
                                        {{^ has_custom_title }}
                                            <span class="dashboard-widget-header-title">{{ title }}</span>
                                        {{/ has_custom_title }}
                                    </h1>
                                    <div class="dashboard-widget-icons">
                                        {{# can_update_dashboards }}
                                            <form method="post" action="{{ url }}">
                                                {{# csrf_token }}
                                                    {{> csrf_token_input }}
                                                {{/ csrf_token }}
                                                <input type="hidden" name="dashboard-id" value="{{ id }}">
                                                <input type="hidden" name="widget-id" value="{{ widget_id }}">
                                                <input type="hidden" name="action" value="{{# is_minimized }}maximize-widget{{/ is_minimized }}{{^ is_minimized }}minimize-widget{{/ is_minimized }}">
                                                <i class="dashboard-widget-icons-minimize fa fa-fw fa-caret-{{# is_minimized }}right{{/ is_minimized }}{{^ is_minimized }}down{{/ is_minimized }}"></i>
                                            </form>
                                        {{/ can_update_dashboards }}
                                        {{# has_actions }}
                                            <div class="tlp-dropdown">
                                                <i class="fa fa-cog fa-fw tlp-dropdown-trigger dashboard-widget-actions"></i>
                                                <div class="tlp-dropdown-menu tlp-dropdown-menu-on-icon tlp-dropdown-menu-right"
                                                     role="menu"
                                                >
                                                    {{# has_rss }}
                                                        <a href="{{ rss_url }}" class="tlp-dropdown-menu-item" role="menuitem">
                                                            <i class="tlp-dropdown-menu-item-icon fa fa-fw fa-rss"></i> {{ rss_label }}
                                                        </a>
                                                    {{/ has_rss }}
                                                    {{# can_update_dashboards }}
                                                        {{# is_editable }}
                                                            <button type="button"
                                                                    class="tlp-dropdown-menu-item edit-widget-button"
                                                                    data-target-modal-id="edit-widget-modal-{{ widget_id }}"
                                                                    role="menuitem"
                                                            >
                                                                <i class="tlp-dropdown-menu-item-icon fa fa-fw fa-pencil"></i> {{ edit_label }}
                                                            </button>
                                                        {{/ is_editable }}
                                                        <button type="button"
                                                                class="tlp-dropdown-menu-item tlp-dropdown-menu-item-danger delete-widget-button"
                                                                data-target-modal-id="delete-widget-modal-{{ widget_id }}"
                                                                role="menuitem"
                                                        >
                                                            <i class="tlp-dropdown-menu-item-icon fa fa-fw fa-trash-o"></i> {{ delete_label }}
                                                        </button>
                                                    {{/ can_update_dashboards }}
                                                </div>
                                            </div>
                                        {{/has_actions}}
                                    </div>
                                </div>
                                {{# can_update_dashboards }}
                                    {{> delete-widget-modal }}
                                    {{# is_editable }}
                                        {{> edit-widget-modal }}
                                    {{/ is_editable }}
                                {{/ can_update_dashboards }}
                                {{^ is_minimized }}
                                    <section class="
                                        tlp-pane-section
                                        dashboard-widget-content
                                        dashboard-widget-content-{{ widget_name }}
                                        {{# is_content_loaded_asynchronously }}
                                            dashboard-widget-asynchronous dashboard-widget-asynchronous-loading
                                        {{/ is_content_loaded_asynchronously }}
                                        "
                                        {{# is_content_loaded_asynchronously }}
                                            data-ajax-url="{{ ajax_url }}"
                                        {{/ is_content_loaded_asynchronously }}
                                    >
                                        {{^ is_content_loaded_asynchronously }}
                                            {{{ content }}}
                                        {{/ is_content_loaded_asynchronously }}
                                    </section>
                                {{/ is_minimized }}
                            </div>
                        </section>
                    {{/ widgets }}
                </div>
                <span class="dashboard-widgets-empty-column {{# can_update_dashboards }}dragula-container{{/ can_update_dashboards }}"></span>
            {{/ widget_columns }}
        </div>
        <span class="dashboard-widgets-empty-line {{# can_update_dashboards }}dragula-container{{/ can_update_dashboards }}"></span>
    {{/ widget_lines }}
</div>
